normal equations for linear models